package src.edu.wayne.cs.csc4110.hw6.implementations.stateMachine;

import src.edu.wayne.cs.csc4110.hw6.implementations.userPanels.PanelFactoryImpl;

public class NotLoggedInState extends AbstractState {

	public NotLoggedInState(StateMachine stateMachine)
	{
		super(stateMachine);
	}
	
	public void goToNotLoggedInState(){
		if (stateMachine.getCurrentUser() == null){
			goToLoggedInState();
		}
		else
		{
			stateMachine.setState(stateMachine.getLoggedInState());
			stateMachine.goToLoggedInState();
		}
	}

	@Override
	public void goToLoggedInState() {
		PanelFactoryImpl.getUserLoginPanel(stateMachine);
	}
}
